"""
任务页面
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class RwHomePage(BasePage):
    url='/crm/index.php?m=task'
    #任务
    rw_home_locator = (By.LINK_TEXT, '任务')
    #定位器
    task_add_locator = (By.XPATH,'/html/body/div[5]/div[2]/div[1]/div/a')
    #首页
    shouye_renwu_locator = (By.CSS_SELECTOR,'#form1 > table > tfoot > tr > td > div.pagination > div.span4 > div > ul > li:nth-child(1) > span')
    #任务统计
    tongji_renwu_locator = (By.CSS_SELECTOR, 'body > div.container > div:nth-child(1) > ul > li:nth-child(2) > a')

    #点击任务
    def click_task(self):
        self.driver.find_element(*self.rw_home_locator).click()
    #点击添加任务
    def add_task(self):
       self.driver.find_element(*self.task_add_locator).click()
    #点击首页
    def click_renwu_shouye(self):
        self.driver.find_element(*self.shouye_renwu_locator).click()
    #点击任务统计
    def click_renwu_tj(self):
        self.driver.find_element(*self.tongji_renwu_locator).click()